package com.ww.springboot.boot.controller;

import lombok.AllArgsConstructor;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.github.benmanes.caffeine.cache.Cache;

/**
 * 描述：
 *
 * @author wanwei
 * @since 2021-08-13 14:13
 */
@RestController
@RequestMapping("Cacheable")
@AllArgsConstructor
public class CacheableController {


    @RequestMapping("map")
    @Cacheable(value = "USER", key = "#key")
    public String find(String key) {
        return String.valueOf(System.currentTimeMillis());
    }


}
